import Vue from 'vue'


/**
 * 时间转化为12月01日(周二)
 */
Vue.filter("monDayWeek", function(input) {
	if(!input) return "";
	let d = new Date(input);	
	let weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];	
	return `${d.getMonth() + 1}月${d.getDate()}日(${weekDay[d.getDay()]})`  
});

/**
 * 时间转化为 周二
 */
Vue.filter("getWeek", function(input) {
	if(!input) return "";
	let d = new Date(input);	
	let weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];	
	return weekDay[d.getDay()]  
});
/**
 * 用户管理用户状态
 */
Vue.filter("userStatus", function(input) {
	if(!input) return "";
	const status = input=='ENABLE' ? "正常" : "不可用";
	return status;  
});
/**
 * 资源类型
 */
Vue.filter("resourceType", function(input) {
	if(!input) return "";
	const type = input=='MENU' ? "菜单" : "按钮";
	return type;  
});